package com.lannuokeji.utils.tags.map;

import java.util.Map;

import org.beetl.core.GeneralVarTagBinding;

/**
 * 字典列表
 * @author zzp
 */
public class DicListTag extends GeneralVarTagBinding {

	public static String tagName = "dicList";
	
	@Override
	public void render() {
		Map<String, String> attrs = (Map<String, String>) this.args[1];
		
		String querySql = "select * from g_config_dictionary ";

		// 接收where需要拼接的条件
		String typeId = attrs.get("typeId");
		if (typeId != null) {
			querySql += " where type_id=";
			querySql += typeId;
		}
		querySql += " order by sort";
		
		// 限制记录条数
		String limit = attrs.get("limit");
		if (limit != null) {
			querySql += " limit ";
			querySql += limit;
		}
//		List<Record> dataList = Db.find(querySql);
//		this.binds(dataList);
		this.doBodyRender();
	}

}
